package com.ntschy.bt.entity.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author lxr
 */
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum BtSupplyShopExamineResultEnum implements IEnum<Integer> {

    /**
     * 审核结果 1-审核通过 2-审核退回
     */
    PASS(1, "审核通过"),
    FAIL(2, "审核退回");


    private final int value;

    //@JsonValue
    private final String desc;

    BtSupplyShopExamineResultEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return desc;
    }

    @JsonCreator
    public static BtSupplyShopExamineResultEnum getBtSupplyShopTypeFromValue(int value) {
        for (BtSupplyShopExamineResultEnum examineResult : BtSupplyShopExamineResultEnum.values()) {
            if(examineResult.getValue() == value) {
                return examineResult;
            }
        }
        return null;
    }
}
